home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / plnk081.zip / pilot-link.0.8.1 / include / pi-todo.hxx < prev   
Text File  |  1997-05-23  |  2KB  |  81 lines

  1.  
  2. #include "pi-appinfo.hxx"
  3.  
  4. const int TODO_APP_INFO_SIZE = 282;
  5.      
  6. class todoAppInfo_t : public appInfo_t
  7. {
  8.      int _dirty;
  9.      int _sortByPriority;
  10.  
  11.      void *internalPack(void *);
  12.      
  13.    public:
  14.      todoAppInfo_t(void *);
  15.  
  16.      int dirty(void) const { return _dirty; }
  17.      int sortByPriority(void) const { return _sortByPriority; }
  18.  
  19.      void *pack(void);
  20. };
  21.  
  22. class todoList_t;
  23.  
  24. class todo_t : public baseApp_t
  25. {
  26.      friend todoList_t;
  27.      
  28.      struct tm *_due;        // Non-NULL if there is a due date
  29.      int _priority;        // A priority in the range 1-5
  30.      int _complete;        // true if the event was completed
  31.      char *_description;    // The line that shows up in a ToDo list
  32.      char *_note;        // Non-NULL if there is a note
  33.  
  34.      todo_t *_next;
  35.      
  36.      void *internalPack(unsigned char *);
  37.      
  38.    public:
  39.      todo_t(void) : baseApp_t() { memset(this, '\0', sizeof(todo_t)); }
  40.      todo_t(void *buf) : baseApp_t() { unpack(buf, 1); }
  41.      todo_t(void *buf, int attr, recordid_t id, int category)
  42.       : baseApp_t(attr, id, category)
  43.       {
  44.            unpack(buf, 1);
  45.       }
  46.      todo_t(const todo_t &);
  47.      
  48.      ~todo_t() {
  49.       if (_due) delete _due;
  50.       if (_description) delete _description;
  51.       if (_note) delete _note;
  52.      }
  53.  
  54.      struct tm *due(void) const { return _due; }
  55.      charConst_t description(void) const { return _description; }
  56.      charConst_t note(void) const { return _note; }
  57.      int priority(void) const { return _priority; }
  58.      int complete(void) const { return _complete; }
  59.      int completed(void) const { return _complete; }
  60.      void unpack(void *, int = 0);
  61.      void *pack(int *);
  62.      void *pack(void *, int *);
  63. };
  64.  
  65. class todoList_t 
  66. {
  67.      todo_t *_head;
  68.  
  69.   public:
  70.      todoList_t(void) : _head(NULL) { }
  71.      ~todoList_t(void);
  72.  
  73.      todo_t *first() { return _head; }
  74.      todo_t *next(todo_t *ptr) { return ptr->_next; }
  75.  
  76.      void merge(todo_t &);
  77.      void merge(todoList_t &);
  78. };
  79.      
  80.      
  81.